<template>
  <div>
    <ul>
        <li v-for="(item,index) in arr" :key="index">
            {{ item }}
        </li>
        <button @click="submit">点击切换</button><br>
        <button @click="con">修改某一项的值</button>
    </ul>
  </div>
</template>

<script>
export default {
    data(){
        return{
            arr:[2,6,4,5,3,4,9]
        }
    },
    methods:{

        submit(){
            // console.log(this.arr[arr.length]);
            this.arr.unshift(this.arr[this.arr.length - 1])
            this.arr.pop(this.arr[this.arr.length - 1])
        },
        con(){
            this.$set(this.arr,6,100)
        }
    }
}
</script>

<style>

</style>